import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

public class test {

    public static void main(String[] args) {
        System.out.println(getDatePickBeforeSeven());
    }

    public static DatePick getDatePickBeforeSeven(){
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        return new DatePick(LocalDate.now().minusDays(7).format(dateTimeFormatter),LocalDate.now().minusDays(1).format(dateTimeFormatter));
    }

    private static class DatePick {
        private final String beginDate;
        private final String endDate;

        public DatePick(String beginDate, String endDate) {
            this.beginDate = beginDate;
            this.endDate = endDate;
        }

        public String getBeginDate() {
            return beginDate + " 00:00:00";
        }

        public String getEndDate() {
            return endDate + " 23:59:59";
        }

        @Override
        public String toString() {
            return "DatePick{" +
                    "beginDate='" + getBeginDate() + '\'' +
                    ", endDate='" + getEndDate() + '\'' +
                    '}';
        }
    }

}
